﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
///ProjectPrivate 的摘要说明
/// </summary>
public class ProjectPrivate
{
  public ProjectPrivate()
  {
    //
    //TODO: 在此处添加构造函数逻辑
    //
  }

  public static bool GetQX(string sQX)
  {
    bool flag = false;
    string sSql = "select * from sys_yhgn where dlm=@0 and xtgnid=@1";
    SqlParameter[] cmdParams = { new SqlParameter("@0", SqlDbType.VarChar, 10), new SqlParameter("@1", SqlDbType.VarChar, 10) };
    cmdParams[0].Value = SysManage.Get_User;
    cmdParams[1].Value = sQX;
    SqlDataReader dr = DbHelperSQL.ExecuteReader(sSql, cmdParams);
    if (dr.Read())
    {
      flag = true;
    }
    dr.Close();
    return flag;
  }

  public static DataSet GetXTGN(string id)
  {
    string sSql = @"select a.gnmc,a.xtgnid,(case when b.dlm is null then 'false' else 'true' end) qx
 from sys_xtgn a left join sys_yhgn b on a.xtgnid=b.xtgnid and b.dlm=@0 order by a.px";
    SqlParameter[] cmdParams = { new SqlParameter("@0", SqlDbType.VarChar, 10) };
    cmdParams[0].Value = string.IsNullOrEmpty(id) ? Convert.DBNull : id;
    DataSet ds = DbHelperSQL.Query(sSql, cmdParams);
    return ds;
  }
}
